angular.module("app").config([
  "$stateProvider",
  "$urlRouterProvider",
  function($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise("map");

    $stateProvider
      .state("map", {
        url: "/map",
        templateUrl: "views/chart/map.html",
        controller: "mapCtrl",
        resolve: {
          loadController: [
            "$ocLazyLoad",
            function($ocLazyLoad) {
              return $ocLazyLoad.load([
                // "js/chart/echarts.min.js",
                // "js/directive/ngEcharts.js",
                "js/controller/charts/mapController.js"
              ]);
            }
          ]
        }
      })
      .state("pie", {
        url: "/pie",
        templateUrl: "views/chart/pie.html",
        controller: "pieCtrl",
        resolve: {
          loadController: [
            "$ocLazyLoad",
            function($ocLazyLoad) {
              return $ocLazyLoad.load("js/controller/charts/pieController.js");
            }
          ]
        }
      })
      .state("lineBar", {
        url: "/lineBar",
        templateUrl: "views/chart/lineBar.html",
        controller: "lineBarCtrl",
        resolve: {
          loadController: [
            "$ocLazyLoad",
            function($ocLazyLoad) {
              return $ocLazyLoad.load(
                "js/controller/charts/lineBarController.js"
              );
            }
          ]
        }
      });
  }
]);
